package com.hyc.seckillsystem.controller;

import com.hyc.seckillsystem.pojo.order;
import com.hyc.seckillsystem.service.orderService;
import com.hyc.seckillsystem.vo.orderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @projectName: seckillsystem
 * @package: com.hyc.seckillsystem.controller
 * @className: orderController
 * @author: 冷环渊 doomwatcher
 * @description: TODO
 * @date: 2022/3/8 14:04
 * @version: 1.0
 */
@Controller
public class orderController {
    @Autowired
    orderService orderService;

    @PostMapping(value = "/create")
    public String createOrder(order order, Model model) {
        System.out.println(order);
        orderVo order1 = orderService.createOrder(order);
        model.addAttribute("orderinfo", order1);
        return "success";
    }
}
